﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GraphDraw
{
    public partial class Form1 : Form
    {           
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {            
            GraphSettings();
        }
        private void GraphSettings()
        {
            var image = new Bitmap(pbGraph.Width, pbGraph.Height);
            var p = new Pen(Brushes.Red, 3);
            using (var myGraph = Graphics.FromImage(image))
            {
                myGraph.TranslateTransform(Size.Width / (float)2, Size.Height / (float)2);
                myGraph.DrawLine(p, 5, 20, 5, -20);
            }
            pbGraph.Image = image;
        }

        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {

        }
    }
}
